From 5449532321be025fd4cc33daaea727049d689b4b Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 23 Nov 2009 06:46:58 +0000 Subject: [PATCH] tmem: printk too chatty when tmem enabled Two gdprintk's that are rarely encountered with tmem disabled are frequent but meaningless when tmem is enabled. Printing these tens-to-hundreds of times per second (in certain circumstances even higher) slows down domain execution. Signed-off-by: Dan Magenheimer --- xen/common/memory.c | 10 ++++++---- xen/common/page_alloc.c | 6 ++++-- xen/include/xen/tmem.h | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/xen/common/memory.c b/xen/common/memory.c index 6627c626f2..11ccdf2fcd 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -120,10 +121,11 @@ static void populate_physmap(struct memop_args *a) page = alloc_domheap_pages(d, a->extent_order, a->memflags); if ( unlikely(page == NULL) ) { - gdprintk(XENLOG_INFO, "Could not allocate order=%d extent: " - "id=%d memflags=%x (%ld of %d)\n", - a->extent_order, d->domain_id, a->memflags, - i, a->nr_extents); + if ( !opt_tmem || (a->extent_order != 0) ) + gdprintk(XENLOG_INFO, "Could not allocate order=%d extent:" + " id=%d memflags=%x (%ld of %d)\n", + a->extent_order, d->domain_id, a->memflags, + i, a->nr_extents); goto out; } diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 7d19bb24e7..c9392a6655 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1049,8 +1049,10 @@ int assign_pages( { if ( unlikely((d->tot_pages + (1 << order)) > d->max_pages) ) { - gdprintk(XENLOG_INFO, "Over-allocation for domain %u: %u > %u\n", - d->domain_id, d->tot_pages + (1 << order), d->max_pages); + if ( !opt_tmem || order != 0 || d->tot_pages != d->max_pages ) + gdprintk(XENLOG_INFO, "Over-allocation for domain %u: " + "%u > %u\n", d->domain_id, + d->tot_pages + (1 << order), d->max_pages); goto fail; } diff --git a/xen/include/xen/tmem.h b/xen/include/xen/tmem.h index ff009b6cf0..1a9b772a69 100644 --- a/xen/include/xen/tmem.h +++ b/xen/include/xen/tmem.h @@ -12,5 +12,6 @@ extern void init_tmem(void); extern void tmem_destroy(void *); extern void *tmem_relinquish_pages(unsigned int, unsigned int); +extern int opt_tmem; #endif /* __XEN_TMEM_H__ */ -- 2.30.2